<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>GraphChi: src/util/pthread_tools.hpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">GraphChi
   &#160;<span id="projectnumber">0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_b7878ad5ecbf2506f4125b9d34c97e45.html">util</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#namespaces">Namespaces</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">pthread_tools.hpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;cstdlib&gt;</code><br/>
<code>#include &lt;memory.h&gt;</code><br/>
<code>#include &lt;pthread.h&gt;</code><br/>
<code>#include &lt;semaphore.h&gt;</code><br/>
<code>#include &lt;sched.h&gt;</code><br/>
<code>#include &lt;signal.h&gt;</code><br/>
<code>#include &lt;sys/time.h&gt;</code><br/>
<code>#include &lt;vector&gt;</code><br/>
<code>#include &lt;cassert&gt;</code><br/>
<code>#include &lt;list&gt;</code><br/>
<code>#include &lt;iostream&gt;</code><br/>
</div>
<p><a href="pthread__tools_8hpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgraphchi_1_1mutex.html">graphchi::mutex</a></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgraphchi_1_1conditional.html">graphchi::conditional</a></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgraphchi_1_1semaphore.html">graphchi::semaphore</a></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgraphchi_1_1spinrwlock.html">graphchi::spinrwlock</a></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">union &#160;</td><td class="memItemRight" valign="bottom"><b>graphchi::spinrwlock::rwticket</b></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgraphchi_1_1rwlock.html">graphchi::rwlock</a></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgraphchi_1_1barrier.html">graphchi::barrier</a></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacegraphchi"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacegraphchi.html">graphchi</a></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ad022064435f5624d1112e6dded65456a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad022064435f5624d1112e6dded65456a"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>_POSIX_SPIN_LOCKS</b>&#160;&#160;&#160;-1</td></tr>
<tr class="memitem:af18b4423b3fbe3bbc8e1fba580e9f959"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af18b4423b3fbe3bbc8e1fba580e9f959"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>SPINLOCK_SUPPORTED</b>&#160;&#160;&#160;0</td></tr>
<tr class="memitem:a97c020c88ee892bb5a3055d5a68c9788"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a97c020c88ee892bb5a3055d5a68c9788"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>atomic_xadd</b>(P, V)&#160;&#160;&#160;__sync_fetch_and_add((P), (V))</td></tr>
<tr class="memitem:a2ecfcce98539a0b972d6fa2586c4e67f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2ecfcce98539a0b972d6fa2586c4e67f"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>cmpxchg</b>(P, O, N)&#160;&#160;&#160;__sync_val_compare_and_swap((P), (O), (N))</td></tr>
<tr class="memitem:a45a583ebc7ce181c15688c871f955e98"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a45a583ebc7ce181c15688c871f955e98"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>atomic_inc</b>(P)&#160;&#160;&#160;__sync_add_and_fetch((P), 1)</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a86d970062f7c0596b53faaabd29cf9a8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a86d970062f7c0596b53faaabd29cf9a8"></a>
typedef mutex&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacegraphchi.html#a86d970062f7c0596b53faaabd29cf9a8">graphchi::spinlock</a></td></tr>
<tr class="memdesc:a86d970062f7c0596b53faaabd29cf9a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">if spinlock not supported, it is typedef it to a mutex. <br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a06eafe9d38f82c61515fbcb151361af0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a06eafe9d38f82c61515fbcb151361af0"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>graphchi::prefetch_range</b> (void *addr, size_t len)</td></tr>
<tr class="memitem:a7cae7ee17128428446762964e0710b47"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7cae7ee17128428446762964e0710b47"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>graphchi::prefetch_range_write</b> (void *addr, size_t len)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A collection of utilities for threading </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jul 5 2012 00:11:18 for GraphChi by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.1
</small></address>
</body>
</html>
